home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
gfx
/
misc
/
lise20.lha
/
lise2.0
/
mdl
/
src
/
skeletton.doc
< prev
next >
Wrap
Text File
|
1993-03-31
|
4KB
|
97 lines
What does skeletton.c do ?
--------------------------
Skeletton.c is a modified version of mdl.c, which gives the
C - programmer easy and convenient access to the menu
routines. You can build your application menu in a very similar way
as with mdl itself.
Why another menu demo, there are so many others around...
---------------------------------------------------------
Most (in fact all that I have seen) Intuition demos initialize theier
structures static, this means extensive and unreadable initialization is
done, and most structures are NOT REENTRANT (This is especially worse for
File Requesters !)
So what programmers want is a procedural initialization and functional
request or variable like readout of requesters and gadgets.
So, here it comes.
Initialization:
---------------
You first have to write your call back routines, which are called
when a menu point is selected, or a push button is pressed.
Then you can add your functions to the intuition list at the main() routine
using:
add_item(x-pos, y-pos,TYPE,"text",opt1 , opt2);
Some items need a callback routine, some need a global variable to write to.
These you can now add with:
fn_command[fn_number] = (void *)CallbackRoutine;
var_value[fn_number] = &GlobalVariable;
Now you have to increment the fn_number.
Available values for TYPE are:
Identifier needs comment
NEW_MENU nothing main point of menue, displayed in menu bar
MENU Callback adds menu point under actual main point
PUSH Callback adds a push button
TOGGLE Global variable adds a toggle button
SCALEX Global variable adds a scaler in x-direction
opt1 = lowest value
opt2 = highest value
SCALEY Global variable adds a scaler in y-direction
SELECTION Global variable + Callback
adds a selector box with predefined items
FILE_SELECT Global variable + Callback
adds a file selector box
STRING Global variable + Callback
adds a string box
Function requesters:
--------------------
You may, at any point of your programm, call a requester either for
reading user input, or displaying a result. The following requesters
are supported:
Help(message_string);
Displays the string in a special window.
Take care, that the string has a LINEFEED
before ending with 0 !
StringBox("title_string",return_string);
Asks the user to type in a string.
FileSelect("title_string",return_string);
Asks the user to choose a file.
A few words about Aztec C:
--------------------------
MDL as well as the skeletton are compiled under Aztec C version 5.0 !
Aztec C complains about one ptr/ptr conversion (warning) (forget it).
There is a real ugly Bug, which occures when you are declaring large
arrays either global or local. May be, this is a 32K or 64K Problem.
The only way around is, to declare pointers and do memory allocation
with malloc by yourself !
Another stupidity is, that the standard C-Function system() is not
implemented. You have to use "Execute" instead.
(Even on the IBM PC the system command works correctly !)
And a last source of headace is the lack of the standard directory
functions and the header file sys/stat.h and related utilities.
WHY THE HELL DID NEITHER MANX NOR LATTICE SUPPORT THESE STANDARDS ?
(again the IBM PC at least knows about these standards)
Such a nice Computer, but so lousy Software !
Go on and try to change something !